const express = require('express')
const app = express()
const bodyParser = require('body-parser')
const homeRouter = require('./routes/home') 
// 引入dao层 数据库连接
require('./model/dao')



app.use(bodyParser.urlencoded({extended:false}))
app.use(bodyParser.json())
// 处理静态资源
app.use(express.static("./public"))

app.set('views',"./views")
app.set("view engine","ejs")

app.use(homeRouter)


app.listen(3000,()=>{console.log('start at port 3000')})